package org.zfes.snowier.cloud.zbss.pmp.router.service.pub;

import java.util.Map;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.cloud.zbss.pmp.model.PmpBugs;
import org.zfes.snowier.cloud.zbss.pmp.service.IPmpBugsService;
import org.zfes.snowier.core.data.DataSet;
@Controller("org.zfes.snowier.cloud.zbss.pmp.router.service.pub.pmpBugsController")
@RequestMapping("/pmp/service/pub/pmpBugs")
public class PmpBugsController extends BaseController {

	@Autowired
	private IPmpBugsService pmpBugsService;
	
    @RequestMapping(value="/loadPmpBugsDataSet", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadPmpBugsDataSet(@RequestParam Map<String,Object> params){
	    DataSet dataSet=  pmpBugsService.loadPmpBugsDataSet(params);
	    return ajaxQuery("dataSet", dataSet);
    }
    
    
    @RequestMapping(value="/loadPmpBugs", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadPmpBugs(Long id){
		Optional<PmpBugs> ops = pmpBugsService.loadPmpBugsById(id);
		return ajaxQuery("pmpBugs",ops);
    }


}